package com.zzz;

import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

import java.io.IOException;

public class ZookeeperUtil {
    private static String connectIp = "192.168.1.52:2181";

    private static int sessionTimeout = 200000;


    public static ZooKeeper connect(Watcher watcher) {
        ZooKeeper zooKeeper = null;
        try {
             zooKeeper = new ZooKeeper(connectIp, sessionTimeout, watcher);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return zooKeeper;
    }
}
